﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Free.Master" Inherits="System.Web.Mvc.ViewPage<Pp.UI.Models.ProjectCreateViewModel>" %>

<%@ Import Namespace="Pp.UI.Models" %>
<%@ Import Namespace="Pp.Dto" %>
<%@ Import Namespace="Pp.Globalization" %>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <%Html.RenderPartial("FormValidateControlScripts"); %>
    <h2>
        <%=Res.Label_NewProject%>
    </h2>
    <% using (Html.BeginForm())
       { %>
    <%: Html.ValidationSummary(true) %>
    <%=Html.TextBox<ProjectCreate>(d => d.Name, Res.Label_Project_Name )%>
    <%=Html.TextArea<ProjectCreate>(d => d.SmallDescription, Res.Label_Project_Short_Descaription )%>
    <%=Html.TextArea<ProjectCreate>(d => d.Description, Res.Label_Project_Slide )%>
    <%=Html.TextBox<ProjectCreate>(d => d.ProjectCosting, Res.Label_Project_Cost + " 'TL' ")%>
    <%=Html.CheckBox<ProjectCreate>(d => d.AllowAllowRequest, Res.Label_Accept_Angel, Res.Label_Allow, Res.Label_Disallow)%>
    <%=Html.FileUploader<ProjectCreate>(d => d.ImageFile, Res.Label_Proje_Img_Browse,UploadType.Image)%>
    <p>
        <%=Res.Label_SignatureCollectMessage %>
    </p>
    <%=Html.TextBox<ProjectCreate>(d => d.SignatureCollect, Res.Label_SignatureCollect)%>
    <%=Html.DropDownList<ProjectCreate>(d => d.CategoryId, Res.Label_Category, Model.Categories, Res.Label_Chooice)%>
    <%=Html.Submit(Res.Label_Create ,false) %>
    <% } %>
    <script>
        bkLib.onDomLoaded(function () {
            var a = new nicEditor().panelInstance('Description');
            if (navigator.appName == "Netscape") {
                $(".nicEdit-main").parent().css("margin-left", "150px");
            }
            var item = $(".nicEdit-main");
            var previous = item.text();
            item.click(function () { this.contentEditable = 'true'; });

            var $check = function () {
                if (item.text() != previous) {
                    $("#Description").html($(item).html());
                    $("form").valid();
                }
                previous = item.text();
            };
            $(document).keyup($check);
            setInterval(function () { $check(); }, 1000);
        });
            
    </script>
</asp:Content>
